package com.publishproject;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.android_base.core.views.bindingViews.adpters.XBaseRecycleAdapter;

import java.util.List;

/**
 * Created by tanghongbin on 2017/9/25.
 */

public class TestRecycleAdapter extends XBaseRecycleAdapter<String,TestRecycleAdapter.Holder> {

    public TestRecycleAdapter(Context mContext, List<String> mList) {
        super(mContext, mList);
    }


    @Override
    public Holder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new Holder(LayoutInflater.from(mContext).inflate(R.layout.test_recycle_item,null));
    }

    @Override
    public void onBindViewHolder(Holder holder, int position) {
        String str = mList.get(position);
        holder.textView.setText(str);
    }

    class Holder extends RecyclerView.ViewHolder{
        protected TextView textView;

        public Holder(View itemView) {
            super(itemView);
            textView = (TextView) itemView.findViewById(R.id.textView);
        }
    }
}
